/**
 * Created by Administrator on 2016/2/14.
 */
$(function(){

    //初始化界面
    function init(){
        $("#detailTextarea").wangEditor();
        html = [];
        if(config.uploadData.img){
            html.push("<img id='uploadImg' src="+config.uploadData.img+">");
        }else{
            html.push("<div class='center-block'>");
            html.push("<input id='uploadImgBtn' type='button' class='btn-info' value='上传活动海报'>");
            html.push("<p class='text-center'>上传尺寸：280 x 172</p>");
            html.push("</div>");
        }
        $("#uploadImgDiv").html(html.join(""));
    }
    init();

    //缓存记录页面数据
    function getDetail(){
        config.uploadData.img = $("#uploadImg").attr("src");
        config.uploadData.atvDesc = $("#detailTextarea").val();
    }
    $("#detailToBase").click(function(){
        getDetail();
        CK.load("html/upLoadActivity/baseInfo",$("#uploadContainer"));

    });
    $("#detailToOption").click(function(){
        getDetail();
        CK.load("html/upLoadActivity/optionSet",$("#uploadContainer"));
    });

    $("#uploadImgBtn").click(function(){

    });
});